package com.bgs.controller;

import com.bgs.common.R;
import com.bgs.pojo.ToReport;
import com.bgs.pojo.vo.ZeroToReportAndOrderDetail;
import com.bgs.service.OrderDetailService;
import com.bgs.service.ToReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 举报 前端控制器
 * </p>
 *
 * @author Asia
 * @since 2021-09-14
 */
@RestController
@RequestMapping("/bgs/to-report")
public class ToReportController {
    @Autowired
    private ToReportService toReportService;
    @Autowired
    private OrderDetailService orderDetailService;
    //对被举报商品全查
    @PostMapping("zeroGetToReportList")
    public R zeroGetToReportList(@RequestBody ZeroToReportAndOrderDetail zeroToReportAndOrderDetail){
        R r=toReportService.zeroGetToReportList(zeroToReportAndOrderDetail);
        return R.ok().data("r",r);
    }

    //对被举报商品全查
    @PostMapping("zeroAddToReport")
    public R zeroAddToReport(@RequestBody ToReport toReport) {
        boolean b = toReportService.zeroAddToReport(toReport);
        return R.ok().data("r", b);
    }
}

